import request from '@/utils/request';

// 用户登陆
export function login(principal) {
  return request.post('/login?grant_type=mini_app', { principal })
}
// 获取验证码
export function getCode(data) {
  return request.post('/p/sms/send', data)
}
//获取收藏数据
export function getClassify() {
  return request.get('/p/user/collection/prods', {
    current: 1,
    size: 10
  })
}
//获取订单数
export function getOrderCount() {
  return request.get("/p/myOrder/orderCount")
}
//获取我的订单数据
export function getOrder(status) {
  return request.get('/p/myOrder/myOrder', {
    current: 1,
    size: 10,
    status: status,
  })
}
//删除订单
export function getDeleteList(id) {
  return request.delete(`p/myOrder/${id}`)
}
// 取消订单
export function getCancel(id) {
  return request.put(`/p/myOrder/cancel/${id}`)
}
//获取订单详情
export function getOrderDetail(id) {
  return request.get('/p/myOrder/orderDetail', {

    orderNumber: id

  })
}
// 付款
export function getPayament (payload){
  return request.post('/p/order/pay',payload)
}
